#ifndef Chronometer_H
#define Chronometer_H

#include <Windows.h>
#include <Winbase.h>
#include <main.h>

namespace rg
{
	struct Chronometer {

		static LARGE_INTEGER m_freq;
		LARGE_INTEGER m_start;
		rgReal m_lapse;	
		string m_label;

		Chronometer (const std::string& label);
		static void init();

		void reset();
		void start();
		void stop();
		void lapse();

		void output(class view* view, rgUint16 x, rgUint16 y);
	};

	struct Chronos 
	{
		vector<Chronometer*> m_Swatches;

		static Chronos& Singleton();
		~Chronos();
		Chronometer* add(const std::string& label);
		Chronometer* get(const std::string& label);
		void Output(class view* view, rgUint16 x, rgUint16 y);
	private:
		Chronos(){;}
	};
}

#endif